package vista;
import java.awt.BorderLayout;
import java.awt.Color;
import java.awt.event.ActionListener;

import javax.swing.BorderFactory;
import javax.swing.ImageIcon;
import javax.swing.JButton;
import javax.swing.JLabel;
import javax.swing.JOptionPane;
import javax.swing.JPanel;
import javax.swing.JTable;
import javax.swing.JTextField;

import javax.swing.WindowConstants;
import javax.swing.border.BevelBorder;
import javax.swing.border.LineBorder;
import javax.swing.table.DefaultTableModel;
import javax.swing.table.TableModel;
import javax.swing.SwingUtilities;

import bean.BtSacfre;
import bean.TablaPlus;
import bean.TxtEscribirLetras;
import bean.TxtEscribirLetrasNumeros;
import bean.TxtEscribirSoloNumeros;


/**
* This code was edited or generated using CloudGarden's Jigloo
* SWT/Swing GUI Builder, which is free for non-commercial
* use. If Jigloo is being used commercially (ie, by a corporation,
* company or business for any purpose whatever) then you
* should purchase a license for each developer using Jigloo.
* Please visit www.cloudgarden.com for details.
* Use of Jigloo implies acceptance of these licensing terms.
* A COMMERCIAL LICENSE HAS NOT BEEN PURCHASED FOR
* THIS MACHINE, SO JIGLOO OR THIS CODE CANNOT BE USED
* LEGALLY FOR ANY CORPORATE OR COMMERCIAL PURPOSE.
*/
public class frmGestionarfresa extends javax.swing.JFrame {
	private JPanel pndatos;
	private JPanel pndatosfresas;
	private BtSacfre btregistrar;
	private JLabel lblcodigo1;
	private JButton btbuscar;
	private JLabel lblcodigo;
	private TablaPlus tbfresas;
	private JLabel lblFresa;
	private BtSacfre btcancelar;
	private BtSacfre btmodificar;
	private BtSacfre bteliminar;
	private TxtEscribirLetras txtnombre;
	private JLabel lblnombre;
	private JOptionPane mensaje;

	/**
	* Auto-generated main method to display this JFrame
	*/
	public static void main(String[] args) {
		SwingUtilities.invokeLater(new Runnable() {
			public void run() {
				frmGestionarfresa inst = new frmGestionarfresa();
				inst.setLocationRelativeTo(null);
				inst.setVisible(true);
			}
		});
	}
	
	public frmGestionarfresa() {
		super();
		initGUI();
	}
	
	private void initGUI() {
		try {
			setDefaultCloseOperation(WindowConstants.DISPOSE_ON_CLOSE);
			this.setTitle("SACFRE/Gestionar Fresa");
			this.setResizable(false);
			{
				pndatos = new JPanel();
				getContentPane().add(pndatos, BorderLayout.CENTER);
				pndatos.setLayout(null);
				pndatos.setPreferredSize(new java.awt.Dimension(821, 461));
				pndatos.setBackground(new java.awt.Color(239,171,183));
				{
					pndatosfresas = new JPanel();
					pndatos.add(pndatosfresas);
					pndatosfresas.setBounds(19, 12, 782, 356);
					pndatosfresas.setBorder(new LineBorder(new java.awt.Color(0,0,0), 1, false));
					pndatosfresas.setBackground(new java.awt.Color(255,219,225));
					pndatosfresas.setLayout(null);
					{
						lblnombre = new JLabel();
						pndatosfresas.add(lblnombre);
						lblnombre.setText("Nombre:");
						lblnombre.setBounds(32, 81, 90, 15);
						lblnombre.setFont(new java.awt.Font("FreeSerif",1,16));
					}
					{
						txtnombre = new  TxtEscribirLetras();
						pndatosfresas.add(txtnombre);
						txtnombre.setBounds(114, 72, 384, 35);
					}
					{
						lblFresa = new JLabel();
						pndatosfresas.add(lblFresa);
						lblFresa.setText("Fresas");
						lblFresa.setBounds(367, 117, 110, 15);
						lblFresa.setFont(new java.awt.Font("Bitstream Charter",1,16));
					}
					{
						String[] columnas ={ "Codigo", "Nombre de la Fresa"};
						tbfresas = new TablaPlus();
						tbfresas.setBounds(48, 140, 688, 193);
						pndatosfresas.add(tbfresas);
						tbfresas.setTablaPlus(columnas);
						tbfresas.setBorder(new LineBorder(new java.awt.Color(0,0,0), 1, false));
						tbfresas.setFont(new java.awt.Font("FreeSerif",1,14));
					}
					{
						lblcodigo = new JLabel();
						pndatosfresas.add(lblcodigo);
						lblcodigo.setText("Codigo:");
						lblcodigo.setBounds(37, 37, 70, 23);
						lblcodigo.setFont(new java.awt.Font("FreeSerif",1,16));
					}
				}
				{
					btregistrar = new BtSacfre();
					pndatos.add(btregistrar);
					btregistrar.setText("Registrar");
					btregistrar.setBounds(217, 387, 141, 58);
					btregistrar.setIcon(new ImageIcon(getClass().getClassLoader().getResource("Iconos/add.png")));
				}
				{
					bteliminar = new BtSacfre();
					pndatos.add(bteliminar);
					bteliminar.setText("Eliminar");
					bteliminar.setBounds(512, 386, 141, 58);
					bteliminar.setIcon(new ImageIcon(getClass().getClassLoader().getResource("Iconos/delete1.png")));
				}
				{
					btmodificar = new BtSacfre();
					pndatos.add(btmodificar);
					btmodificar.setText("Modificar");
					btmodificar.setBounds(364, 387, 141, 58);
					btmodificar.setIcon(new ImageIcon(getClass().getClassLoader().getResource("Iconos/edit.png")));
				}
				{
					btcancelar = new BtSacfre();
					pndatos.add(btcancelar);
					btcancelar.setText("Cancelar");
					btcancelar.setBounds(659, 385, 141, 58);
					btcancelar.setIcon(new ImageIcon(getClass().getClassLoader().getResource("Iconos/delete.png")));
				}
				{
					btbuscar = new BtSacfre();
					pndatosfresas.add(btbuscar);
					btbuscar.setBounds(219, 31, 32, 35);
					btbuscar.setBorder(BorderFactory.createEtchedBorder(BevelBorder.LOWERED));
					btbuscar.setBackground(new java.awt.Color(247,218,223));					
					btbuscar.setIcon(new ImageIcon(getClass().getClassLoader().getResource("Iconos/search.png")));
					btbuscar.setBorderPainted(false);
				}
				{
					lblcodigo1 = new JLabel();
					pndatosfresas.add(lblcodigo1);
					lblcodigo1.setText("00000");
					lblcodigo1.setBounds(113, 32, 100, 33);
					lblcodigo1.setFont(new java.awt.Font("FreeSerif",1,32));
				}
			}
			pack();
			this.setSize(823, 487);
		} catch (Exception e) {
		    //add your error handling code here
			e.printStackTrace();
		}
	}

	public TxtEscribirLetras getTxtnombre() {
		return txtnombre;
	}

	public JPanel getPndatos() {
		return pndatos;
	}

	public JPanel getPndatosfresas() {
		return pndatosfresas;
	}

	public BtSacfre getBtregistrar() {
		return btregistrar;
	}

	public TablaPlus getTbfresas() {
		return tbfresas;
	}

	public JLabel getLblFresa() {
		return lblFresa;
	}

	public JLabel getLblcodigo1() {
		return lblcodigo1;
	}

	public BtSacfre getBtcancelar() {
		return btcancelar;
	}

	public BtSacfre getBtmodificar() {
		return btmodificar;
	}

	public BtSacfre getBteliminar() {
		return bteliminar;
	}

	public JLabel getLblnombre() {
		return lblnombre;
	}
	
	public JOptionPane getMensaje() {
		return mensaje;
	}

	public JButton getBtbuscar() {
		return btbuscar;
	}

	public JLabel getLblcodigo() {
		return lblcodigo;
	}

	public void AgregarEscuchadores(ActionListener actionlistener){
		this.btregistrar.addActionListener(actionlistener);
		this.btmodificar.addActionListener(actionlistener);
		this.bteliminar.addActionListener(actionlistener);
		this.btcancelar.addActionListener(actionlistener);	
		this.btbuscar.addActionListener(actionlistener);
	}

}
